class WinnerOfGame:
    #  如果相邻两个颜色均相同则删除当前颜色 贪心 分别计算出  Alice 和  Bob 的操作数
    def winnerOfGame(self, colors: str) -> bool:
        freq = [0, 0]
        cur, cnt = 'C', 0
        for c in colors:
            if c != cur:
                cur = c
                cnt = 1
            else:
                cnt += 1
                if cnt >= 3:
                    freq[ord(cur) - ord('A')] += 1
        return freq[0] > freq[1]

    @staticmethod
    def mainDemo():
        s = WinnerOfGame()
        words = "AAABABB"
        print(s.winnerOfGame(words))
